#!/bin/bash
set -o errexit

DOMAIN=${1:-magento.test}
VERSION=${2:-2.4.5}
EDITION=${3:-community}

# curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash
curl -s https://gitee.com/imwenzhu/docker-magento/raw/master/lib/template | bash

# &&'s are used below otherwise onelinesetup script fails/errors after bin/download
bin/download "${VERSION}" "${EDITION}" \
  && bin/setup "${DOMAIN}"
